package Demo1;
class Student implements Cloneable{
    public int age;
    public String name;

    public Student(int age, String name) {
        this.age = age;
        this.name = name;
    }

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
public class Test {
    public static void main(String[] args) throws CloneNotSupportedException {
        Student student1=new Student(24,"man");
        Student student2=(Student) student1.clone();
        System.out.println(student2.age+" "+student2.name);
    }
}
